import time

from selenium.webdriver.chrome import webdriver
from selenium.webdriver.common.by import By


class SigninPage():
    unameE = (By.NAME, "username")
    upwdE = (By.NAME, "password")
    rtypeE = (By.CSS_SELECTOR, ".us_Submit")

    def denglu(self, a, b):
        dl = webdriver.WebDriver()
        dl.get("http://192.168.88.132/user.php")
        dl.implicitly_wait(10)
        dl.find_element(*self.unameE).send_keys(a)
        dl.find_element(*self.upwdE).send_keys(b)
        dl.find_element(*self.rtypeE).click()


if __name__ == '__main__':
    # sp = SigninPage()
    # sp.denglu('chen', 'chen123456')
    import os.path
    import allure
    import pytest

    from config.config import data_path
    from tools.doFiles import DoExcel

    from ecshop.signinPage import SigninPage

    eFile = os.path.join(data_path, "csyl.xlsx")
    regPage = DoExcel().readExcelRowCol(eFile, "regPage", 2, 3, 1, 5)
    signinPage = DoExcel().readExcelRowCol(eFile, "signinPage", 2, 3, 1, 2)
    print(signinPage)
